from po.base.Base import Base
import time
from selenium.webdriver.common.by import By
class Page(Base):
    #点击进入登录页面

    movie_button=(By.XPATH,'/html/body/div[1]/div/section/aside/ul/li/ul/li[4]/a')
    def movie(self):
        self.click(self.movie_button)

    #输入用户名
    username_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/div[1]/div/input')
    def username(self):
        self.send_keys(self.username_loc,'13228720890')
    #输入密码
    password_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/div[2]/div/input')
    def password(self):
        self.send_keys(self.password_loc,'12345678')

    #点击登录按钮
    button_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/button[2]')
    def button(self):
        self.click(self.button_loc)

    #点击确认密码
    ok_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[2]/div/div/div/div[2]/button[2]')
    def ok(self):
        self.click(self.ok_loc)

    pin_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div/div[2]/div/div/button[2]')
    def pin(self):
        self.click(self.pin_loc)
    id_send=(By.XPATH,'/html/body/div[1]/div/section/section/main/div/div/div[1]/div/input')
    def id(self):
        self.send_keys(self.id_send,'9')

    message_send=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[1]/div/div[1]/div/input')
    def message(self):
        self.send_keys(self.message_send,'这个电影很感人')

    score_send=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[2]/div/div[1]/div/input')
    def score(self):
        self.send_keys(self.score_send,'7')

    time_send=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[3]/div/div[1]/div/input')
    def time(self):
        self.send_keys(self.time_send,'2025-5-13')

    movie_send=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[4]/div/div[1]/div/input')
    def movie_name(self):
        self.send_keys(self.movie_send,'1')

    user_send=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[5]/div/div[1]/div/input')
    def user_name(self):
        self.send_keys(self.user_send,'1')

    commit_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[6]/div/button[1]')
    def commit(self):
        self.click(self.commit_loc)


    def login_01(self):
        self.open_url('http://localhost:8080')
        time.sleep(2)
        self.movie()
        time.sleep(2)
        self.username()
        time.sleep(2)
        self.password()
        time.sleep(2)
        self.button()
        time.sleep(2)
        self.ok()
        time.sleep(2)
        self.pin()
        time.sleep(2)
        self.id()
        time.sleep(2)
        self.message()
        time.sleep(2)
        self.score()
        time.sleep(2)
        self.time()
        time.sleep(2)
        self.movie_name()
        time.sleep(2)
        self.user_name()
        time.sleep(2)
        self.commit()
        time.sleep(2)








